#pragma once

#include <vector>
#include "common.h"

class ITrendDetector
{
public:
	ITrendDetector();
	virtual ~ITrendDetector();

	void AddSample(uint64 val);
	//void Clear();

	virtual bool CalcIncreasingTrend(bool prep=true) = 0;

protected:
	void Dump();
	void preprocess();

	//uint64 * m_pRec;
	//int m_idx;
	std::vector<uint64> m_samples;
	std::vector<uint64> m_presamples;
	uint64 m_midMean;
};

class PCDTTrendDetector: public ITrendDetector
{
public:
	virtual bool CalcIncreasingTrend(bool prep=true);
private:
	float GetPCT(); 
	float GetPDT();
};

class SpearmanTrendDetector : public ITrendDetector
{
public:
	virtual bool CalcIncreasingTrend(bool prep=true);
};

class SimPearson
{
public:
	virtual bool IsCorrelated();
	void AddSample(uint32 x, uint32 y);
	void Clear();
	void Dump();

private:
	std::vector<double> m_x;
	std::vector<double> m_y;
	std::vector<double> m_preX;
	std::vector<double> m_preY;
};